package customerEnter.Frame.JDBCDao.Interface;

import java.util.LinkedList;

import org.springframework.jdbc.support.rowset.SqlRowSet;

import customerEnter.Frame.DaoDataTransmission.DaoFrameDMLBaseTransmission;
import customerEnter.Frame.DaoDataTransmission.DaoFramePameTransmission;

/**
 * 中間層
 * 
 * 类名称：DaoFrameIntermediateLayerInterface 类描述： 创建人：dy 创建时间：2017-3-30 上午9:51:45
 * 
 */
public interface DaoFrameIntermediateLayerInterface<T, K> {

	/**
	 * 批量增加 獲取sql語句 單個
	 */
	public String SqlInsertBacth(String DataBase, String TableName, Class<?> class1);

	/**
	 * 獲取Result的結果集
	 * 
	 * 
	 * 
	 */
	public SqlRowSet FindResultSetSql(DaoFramePameTransmission<T, K> daoFramePameTransmission);

	/**
	 * 功能： 判斷緩存有沒有 緩存存活3分鐘 用json sql語句為key 保證同一條sql語句 3分鐘內只訪問一次數據庫 包括沒緩存的時候查詢數據庫
	 */
	public void IfEhcache(DaoFrameDMLBaseTransmission daoFrameDMLBaseTransmission,
			DaoFramePameTransmission<T, K> daoFramePameTransmission);

	/**
	 * 增加方法
	 */
	public void setInsertSql(DaoFramePameTransmission<T, K> daoFramePameTransmission, String DataBase,
			String TableName, LinkedList<?> values);

	/**
	 * 增加數據的方法
	 * 
	 * @throws ReflectiveOperationException
	 * @throws IllegalArgumentException
	 */
	public void setInsertMappingSql(DaoFramePameTransmission<T, K> daoFramePameTransmission, String DataBase,
			String TableName, Object t) throws Exception;

	/**
	 * 修改數據的方法
	 * 
	 * @throws ReflectiveOperationException
	 * @throws IllegalArgumentException
	 */
	public void setUpdateMappingSql(DaoFramePameTransmission<T, K> daoFramePameTransmission, String DataBase,
			String TableName, Object t, String where) throws Exception;

	/**
	 * 判断sql语句是否有误
	 */
	public String IfSqlError(DaoFramePameTransmission<T, K> daoFramePameTransmission);

	public SqlRowSet setResultQuery(DaoFramePameTransmission<T, K> daoFramePameTransmission);

	/**
	 * 設置查找數據庫 單個rs 結果
	 * 
	 */
	public void setfindConditionQuery(DaoFramePameTransmission<T, K> daoFramePameTransmission);

	/**
	 * 獲取泛型的名字
	 */
	public String getClassName(T t);

	/**
	 * 獲取類型的名字
	 */
	public String getClassName(Class<?> class1);

	/**
	 * 封裝rs
	 */
	public void setResult(DaoFramePameTransmission<T, K> daoFramePameTransmission);

}
